package cn.hs.controller;

import cn.hs.entity.CourseMark;
import cn.hs.pojo.CourseMarkSelect;
import cn.hs.service.CourseMarkService;
import cn.hs.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @ClassName CourseMarkController
 * @Description TODO
 * @Author yun
 * @Date 2024年10月23日 19:25
 * @Version 1.0
 */
@RestController
@RequestMapping("/courseMark")
public class CourseMarkController {

    @Autowired
    @Qualifier("courseMarkServiceImpl")
    private CourseMarkService service;

    @PostMapping("/add")
    public Result add(@RequestBody CourseMark courseMark){
        courseMark.setCreateTime(new Date());
        return  service.add(courseMark);
    }

    @PostMapping("/delete")
    public Result delete(Integer id){
        return  service.delete(id);
    }

    @PostMapping("/update")
    public Result update(@RequestBody CourseMark courseMark){
        return  service.update(courseMark);
    }

    @GetMapping("/list")
    public Result selectAll(CourseMarkSelect select){
        return service.selectAll(select);
    }

    @GetMapping("/selectById")
    public Result selectById(Integer id){
        return service.selectById(id);
    }


}
